<%@page import="java.sql.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<jsp:useBean id="databaseBean" scope="session" class="warehouse.DatabaseBean"/>    

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>订单信息一览表</title>

<link rel="stylesheet" href="layui/css/layui.css">
<script src="layui/layui.js"></script>
</head>
<body>
	<h1 style="text-align:center">订单信息一览表</h1>
	<table class="layui-table" lay-even>
		<thead>
		<tr>
			<th>订单号</th>
			<th>下单日期</th>
			<th>客户编号</th>
			<th>联系人</th>
			<th>客户联系方式</th>
			<th>订单状态</th>
			<th>查看详情</th>
		</tr>
		</thead>
		<%
		String sql="SELECT * FROM orders,client WHERE orders.clientNo=client.clientNo ORDER BY orderDate;";
		ResultSet rs=databaseBean.executeQuery(sql);
		while(rs.next()){
			%>
			<tr>
				<td><%=rs.getString("orderNo")  %></td>
				<td><%=rs.getString("orderDate")  %></td>
				<td><%=rs.getString("clientNo")  %></td>
				<td><%=rs.getString("name")  %></td>
				<td><%=rs.getString("telenumber")  %></td>
				<td><%=rs.getInt("state")==0?"未完成":"已完成"%></td>	
				<td>
					<a href="<%="order.jsp?orderNo="+ rs.getString("orderNo")%>" 
					class="layui-btn">查看详情</a>
				</td>
			</tr>		
			<%
		}
		rs.close();
		%>
	</table>
</body>
</html>